package com.csis.system.domain;

import static com.csis.system.common.IStaticData.COLUMN_SALELIST_CUSTOMERID;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_DISCOUNT;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_PRODUCTCOLOR;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_PRODUCTCOUNT;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_PRODUCTID;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_PRODUCTPRICE;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_PRODUCTSIZE;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_SALEDATE;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_SALENO;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_SALENOTE;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_SALESTATUS;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_TOTAL;
import static com.csis.system.common.IStaticData.COLUMN_SALELIST_USERID;
import static com.csis.system.common.IStaticData.TABLE_SALELIST;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.csis.system.common.IStaticData;

@Entity
@Table(name = TABLE_SALELIST)
public class Salelist {
	@Id
	@Column(name = COLUMN_SALELIST_SALENO)
	private java.lang.String id = null;
	@Column(name = COLUMN_SALELIST_CUSTOMERID)
	private java.lang.Integer customerId = null;
	@Column(name = COLUMN_SALELIST_SALEDATE)
	private java.util.Date saleDate = null;
	@Column(name = COLUMN_SALELIST_USERID)
	private java.lang.Integer userId = null;
	@Column(name = COLUMN_SALELIST_PRODUCTID)
	private java.lang.Integer productId = null;
	@Column(name = COLUMN_SALELIST_PRODUCTCOUNT)
	private java.lang.Integer productCount = null;
	@Column(name = COLUMN_SALELIST_PRODUCTCOLOR)
	private java.lang.String productColor = null;
	@Column(name = COLUMN_SALELIST_PRODUCTSIZE)
	private java.lang.String productSize = null;
	@Column(name = COLUMN_SALELIST_PRODUCTPRICE)
	private java.lang.Float productPrice = null;
	@Column(name = COLUMN_SALELIST_DISCOUNT)
	private java.lang.Float discount = null;
	@Column(name = COLUMN_SALELIST_TOTAL)
	private java.lang.Float total = null;
	@Column(name = COLUMN_SALELIST_SALESTATUS)
	private java.lang.Integer saleStatus = null;
	@Column(name = COLUMN_SALELIST_SALENOTE)
	private java.lang.String saleNote = null;

	@Transient
	private Customer customer = new Customer();
	@Transient
	private User user = new User();

	@Transient
	private Product product;

	public String get_status() {
		return saleStatus == 0 ? IStaticData.SALE_STATUS_INVALID : IStaticData.SALE_STATUS_VALID;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public java.lang.String getId() {
		return id;
	}

	public void setId(java.lang.String saleNo) {
		this.id = saleNo;
	}

	public java.lang.Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(java.lang.Integer customerId) {
		this.customerId = customerId;
	}

	public java.util.Date getSaleDate() {
		return saleDate;
	}

	public void setSaleDate(java.util.Date saleDate) {
		this.saleDate = saleDate;
	}

	public java.lang.Integer getUserId() {
		return userId;
	}

	public void setUserId(java.lang.Integer userId) {
		this.userId = userId;
	}

	public java.lang.Integer getProductId() {
		return productId;
	}

	public void setProductId(java.lang.Integer productId) {
		this.productId = productId;
	}

	public java.lang.Integer getProductCount() {
		return productCount;
	}

	public void setProductCount(java.lang.Integer productCount) {
		this.productCount = productCount;
	}

	public java.lang.String getProductColor() {
		return productColor;
	}

	public void setProductColor(java.lang.String productColor) {
		this.productColor = productColor;
	}

	public java.lang.String getProductSize() {
		return productSize;
	}

	public void setProductSize(java.lang.String productSize) {
		this.productSize = productSize;
	}

	public java.lang.Float getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(java.lang.Float productPrice) {
		this.productPrice = productPrice;
	}

	public java.lang.Float getDiscount() {
		return discount;
	}

	public void setDiscount(java.lang.Float discount) {
		this.discount = discount;
	}

	public java.lang.Float getTotal() {
		return total;
	}

	public void setTotal(java.lang.Float total) {
		this.total = total;
	}

	public java.lang.Integer getSaleStatus() {
		return saleStatus;
	}

	public void setSaleStatus(java.lang.Integer saleStatus) {
		this.saleStatus = saleStatus;
	}

	public java.lang.String getSaleNote() {
		return saleNote;
	}

	public void setSaleNote(java.lang.String saleNote) {
		this.saleNote = saleNote;
	}

}
